<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<link href="images/fox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/jquery.js"></script>
 <script type='text/javascript' src='/scm/dwr/interface/Jpurchase.js'></script>
 <script type='text/javascript' src='/scm/dwr/engine.js'></script>

<script type="text/javascript" language="JavaScript">

/*$(function(){  //文档加载 
$(".tbody tr").hover( 
  function(){ 
    $(this).addClass("hover");    //鼠标经过添加hover样式 
  }, 
  function(){ 
    $(this).removeClass("hover");   //鼠标离开移除hover样式 
  } 
); 
}); */
	var Id=0;
	function updatecount(id){
	Id=id
		var currens=document.getElementById(Id);
		currens.cells[7].innerHTML="<a href='javascript:updatecount1()' style='color:#000099'>保存</a>";
		var count=currens.cells[5].innerHTML;
		currens.cells[5].innerHTML="<input id='cs' value='"+count+"'/>";

		
		
		
	}
	function updatecount1(){
		var geshi=/^[0-9]*[1-9][0-9]*$/;
		var cout=document.getElementById("cs").value;
		if(!geshi.test(cout)){
			alert("请输入正确的数字格式");
		}else{
			Jpurchase.updateyear(Id,cout,update);
			
		}
		

		
		
		
	}
	function update(){
		
	var cout=document.getElementById("cs").value;

	var currens=document.getElementById(Id);
	currens.cells[7].innerHTML="<a href='javascript:updatecount("+Id+")' style='color:#000099'>修改</a>";
	currens.cells[5].innerHTML=cout;
	currens.cells[8].innerHTML="<a href='purchaseaction!monthquerychase.action?ids="+Id+"&&ycount="+cout+"' style='color:#000099'>分解计划</a>";
	Id=0;
	
	
	}
	
</script> 
<style type="text/css"> 
.hover{background-color:#CACACA;}  /*这里是鼠标经过时的颜色*/ 
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>
<body>
	
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="/images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">采购管理</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
		<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="line_table">
		<tr>
		<td width="20">
		<img src="images/icon-login-seaver.gif" width="16" height="16" />
		</td>
		<td>
		当前位置：采购管理>>制定全年采购计划(developmentProcurementPlan.html)
		</td>

	</tr>
	</table>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="line_table">
		<tr>
		<td width="100%" align="center">
		<input type="submit" class="Submit" value="创建本年计划" onclick="window.location='purchaseaction!queryYearpurchase.action'"/>
		<input type="button" class="Submit" value="查看历史记录" onclick="window.location='purchaseaction!querYearpurchases.action'"/>
		 </td>

	</tr>
	</table>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="line_table">
		<thead class="thead">
		
    	<tr>
		<th width="7%">序号</th>
		<th width="7%">年份</th>
		<th width="13%">品牌</th>
		<th width="15%">车型编码</th>	
		<th width="19%">车型特征</th>	
		<th width="13%">计划数量</th>	
		<th width="13%">已采购</th>
		<th width="13%" colspan="2">操作</th>
		
		</tr>
		</thead>
		<tbody class="tbody">
		<s:iterator value="list" var="purchase" status="st">
		<tr id="<s:property value="#purchase.yearPurchaseId"/>">
		<td ><s:property value="#st.count"/></td>
		<td><s:property value="#purchase.year"/></td>
		<td><s:property value="#purchase.modeldictionary.brand.brandName"/></td>
		<td><s:property value="#purchase.modeldictionary.modelCode"/></td>	
		<td><s:property value="#purchase.modeldictionary.modelFeature"/></td>	
		<td><s:property value="#purchase.planPurchaseCount"/></td>	
		<td><a style="color:#CC0000"><s:property value="#purchase.purchaseCount"/></a></td>
		<td>
		<a href="javascript:updatecount(${purchase.yearPurchaseId})" style="color:#000099"  >修改</a>
		</td>
		<td>

		<%--<input  onclick="updatecount(this,${purchase.yearPurchaseId})" type="button" value="修改"/> --%>
		<s:if test="#purchase.status==0">
		<s:url id="monthurl" action="purchaseaction!monthquerychase.action">
			<s:param name="ids" value="%{#purchase.yearPurchaseId}"></s:param>
			<s:param name="ycount" value="%{#purchase.planPurchaseCount}"></s:param>
		</s:url>
		<s:a href="%{monthurl}" cssStyle="color:#000099">分解计划</s:a>
		</s:if>
		<s:else>
		<s:url id="selecturl" action="purchaseaction!querymonthpurchase.action">
			<s:param value="%{#purchase.yearPurchaseId}" name="yid"></s:param>
		</s:url>
		<s:a href="%{selecturl}" cssClass="color:#000099">查看</s:a>
		</s:else>
		<%--<a href="decompositionProcurementPlanCreate.html" style="color:#000099">分解计划</a> --%>
		</td>
		</tr>
		</s:iterator>
		</tbody>		
    </table>
				<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="line_table">
		<tr>
		  <td width="869">&nbsp;</td>
		  <td width="63" align="right"><a href="purchaseaction!querypurchaselist.action?count=1"><span class="left_ts">首页</span></a></td>
		  <td width="63" align="right"><a href="purchaseaction!querypurchaselist.action?count=${pre}"><span class="left_ts">上一页</span></a></td>
		  <td width="63" align="center"><span class="admin_toptxt">${count}/${zong}</span></td>
		  <td width="66" align="left"><a href="purchaseaction!querypurchaselist.action?count=${next}"><span class="left_ts">下一页</span></a></td>
		  <td width="63" align="left"><a href="purchaseaction!querypurchaselist.action?count=${zong}"><span class="left_ts">尾页</span></a></td>
		</tr>
	</table>
	</td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
页面说明：<br />
1.默认显示本年的所有车型的所有采购计划。<br />
2.分解计划:如果该车型在创建全年计划后未进行分解，那么在页面显示的是分解计划，如果计划已经分解那么在页面显示的是查看。<br />
3.已采购是统计出来的信息表示2009年已经采购入库的车辆。<br />
4.点击修改后，计划数量变为文本框并且将原先的数字默认输入到文本框内，同时修改变为保存，当点击保存后需要做非空和有效性验证。
</body>
</html>